import struct

file010 = "010-00.bin"
file020 = "020-00.bin"
file040 = "040-00.bin"
file040up = "040-up.bin"


with open(file040,mode='wb+') as f:
    # 8k  2**13
    # 32k 2**15
    # 64k 2**16
    for i in range(2**19):
        s = struct.pack('B',0x00)
        f.write(s)

with open(file010,mode='wb+') as f:
    # 8k  2**13
    # 32k 2**15
    # 64k 2**16
    for i in range(2**17):
        s = struct.pack('B', i & 0xff)
        if i<0x1ff:
            s = struct.pack('B', i & 0xff)
        else:
            s = struct.pack('B', 0xff)
        f.write(s)

with open(file020,mode='wb+') as f:
    # 8k  2**13
    # 32k 2**15
    # 64k 2**16
    for i in range(2**18):
        s = struct.pack('B',0x00)
        f.write(s)


## 测试芯片用
with open(file040up,mode='wb+') as f:
    for i in range(2**19):
        s = struct.pack('B', i & 0xff)
        if i & 0xff == 0:
            s = struct.pack('B', (i >> 16) & 0xff)
        if i & 0xff == 1:
            s = struct.pack('B', (i >> 8) & 0xff)
        f.write(s)